package com.summer_administration.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class Expenses {
    private Integer id;
    @NotNull private String title;
    private String groupId;
    @NotNull private String groupName;
    @NotNull private Integer number;
    @NotNull private String method;
    @NotNull private String picture;
    @NotNull private String state;
    @NotNull private String date;  // 格式：yyyy-MM-dd
    private String remark;
    private Integer createUser;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}

/*
@Data
public class Expenses {
    private Integer id;
    @NotNull private String title;
    @NotNull private Integer number;

    @NotNull
    @JsonIgnore  // 序列化时忽略
    private String groupId;

    @NotNull private String method;
    @NotNull private String picture;
    @NotNull private String date;
    @NotNull private String state;
    private String remark;
    private Integer createUser;

    private String groupName;  // 新增字段

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}*/
